# vim:filetype=python

@register
class Itk(LibExt):
    register_names = ['itk']

    version = '3.13'

    depends_on     = ['vxl']

    libs = [
            'ITKAlgorithms',
            'ITKStatistics',
            'ITKCommon',
            'itkvnl_inst',
            'ITKNumerics',
            'itksys',
            'itkNetlibSlatec',
            'ITKStatistics',
            'ITKFEM',
            'ITKBasicFilters',
            'ITKIO',
            'ITKNrrdIO',
            'ITKSpatialObject',
            'ITKDICOMParser',
            'ITKniftiio',
            'ITKMetaIO',
            'ITKznz',
            'ITKEXPAT',
            'itkjpeg8',
            ]

    extra_libs = [
            'pthread',
            'm',
            'vnl_algo',
            'vcl',
            'vnl',
            'netlib',
            'dl',
            'gdcmMSFF',
            ]

    frameworks = [
            'CoreServices',
            'IOKit',
            'Carbon',
            'Cocoa',
            'System',
            ]

    cxxflags = [
            '-Wall',
            ]

    cpppath = [
            ('include','itk'),
            ('include','itk','Numerics','Statistics'),
            ('include','itk','Algorithms'),
            ('include','itk','BasicFilters'),
            ('include','itk','Common'),
            ('include','itk','Numerics'),
            ('include','itk','IO'),
            ('include','itk','Numerics','FEM'),
            ('include','itk','Numerics','NeuralNetworks'),
            ('include','itk','SpatialObject'),
            ('include','itk','Utilities','MetaIO'),
            ('include','itk','Utilities','NrrdIO'),
            ('include','itk','Utilities','DICOMParser'),
            ('include','itk','Utilities','expat'),
            ('include','itk','Utilities','nifti','niftilib'),
            ('include','itk','Utilities','nifti','znzlib'),
            ('include','itk','Utilities','itkExtHdrs'),
            ('include','itk','Utilities'),
            ('include','itk','build','gdcm','posix_DEBUG'),
            ('include','itk','include'),
            ('include','itk','include'),
            ('include','itk','include','libxml2'),
            ]

    debug_suffix   = "_D"

    def darwin(self):
        self.extra_libs += ['iconv']
        self.libs.remove('itkNetlibSlatec')

    def linux(self):
        self.cxxflags = [
            '-ftemplate-depth-50',
            '-Wall',
            '-Wno-deprecated'
            ]
        if self.arch == '32':
            self.libs.remove('itkNetlibSlatec')


    def windows(self):
        self.cxxflags = []
        self.cppdefines = ['NOMINMAX']
        self.extra_libs = [
            'comctl32',
            'wsock32',
            'ws2_32',
            'kernel32.lib',
            'user32.lib',
            'gdi32.lib',
            'winspool.lib',
            'comdlg32.lib',
            'advapi32.lib',
            'shell32.lib',
            'ole32.lib',
            'oleaut32.lib',
            'uuid.lib',
            'odbc32.lib',
            'odbccp32.lib',
            'vnl_algo',
            'vcl',
            'vnl',
            'netlib',
            'testlib',
            'gdcmMSFF',
            ]
        
        self.libs = [
            'ITKAlgorithms',
            'ITKBasicFilters',
            'ITKCommon',
            'ITKFEM',
            'ITKIO',
            'ITKMetaIO',
            'ITKNrrdIO',
            'ITKNumerics',
            'ITKSpatialObject',
            'ITKStatistics',
            'ITKniftiio',
            'ITKznz',
            'itkpng',
            'itksys',
            'itktiff',
            'itkvnl',
            'itkvnl_algo',
            'itkvnl_inst',
            'itkjpeg8',
            'itkjpeg12',
            'itkjpeg16',
            'ITKDICOMParser',
            'ITKEXPAT',
            'itkzlib',
            'itkvcl',
            'itkv3p_netlib',
            ]

   

